{% extends 'task_market/base.html' %}
{% load static %}


{% block title %}
    全部任务
{% endblock %}

{% block content %}

    <div class="breadcrumbs">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="bread-inner">
                        <ul class="bread-list">
                            <li><a href="{% url 'task_market:index' %}" target="_blank">主页<i
                                    class="ti-arrow-right"></i></a></li>
                            <li class="active"><a href="#">全部任务</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <section class="product-area shop-sidebar shop section">
        <div class="container">
            <div class="row">
                <div class="col-lg-9 col-md-8 col-12 mx-auto">
                    <div class="shop-top">
                        <div class="row">
                            <div class="col-lg-2 filter-single">
                                <div class="filter-content">
                                    <div class="my-auto filter-title">Show :</div>
                                    <select>
                                        <option selected="selected">10</option>
                                        <option>20</option>
                                        <option>30</option>
                                        <option>50</option>
                                        <option>100</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-8 filter-single">
                                <div class="filter-content">
                                    <div class="my-auto filter-title">Sort By :</div>
                                    <select>
                                        <option selected="selected">Latest</option>
                                        <option>Latest</option>
                                        <option>Trending</option>
                                        <option>Popular</option>
                                        <option>Price Hight To Low</option>
                                        <option>Price Low To High</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-2 filter-single">
                                <ul class="view-mode">
                                    <li><a href="{% url 'task_market:all_grid' %}"><i class="fal fa-th-large"></i></a>
                                    </li>
                                    <li class="active"><a href="{% url 'task_market:all_list' %}"><i
                                            class="fal fa-th-list"></i></a></li>
                                </ul>
                            </div>
                        </div>

                    </div>
                    <div class="row">
                        {% for task in tasks %}
                            <div class="col-12 mt-4">
                                <div class="single-product">
                                    <div class="row">
                                        <div class="col-lg-3">
                                            <div class="product-img">
                                                <a href="{% url 'task_market:details' id=task.id %}" target="_blank">
                                                    <img class="product-img"
                                                         src="{% static 'temp_shop/assets/img/products/p14.png' %}"
                                                         alt="#">
                                                    <span class="price-dec">{{ task.id }}</span>
                                                </a>
                                                <div class="button-head">
                                                    <div class="product-action">
                                                        <a data-bs-toggle="modal"
                                                           data-bs-target="#staticBackdrop{{ task.id }}" href="#"><i
                                                                class="far fa-eye"></i><span>Quick Shop</span></a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-lg-8">
                                            <div class="product-content">
                                                <h2><a href="{% url 'task_market:details' id=task.id %}"
                                                       target="_blank">{{ task.task_name }}</a></h2>
                                                <div class="d-flex justify-content-between">
                                                    <div class="product-price" style="color: red;">
                                                        <span>任务等级：{{ task.task_rank }}</span>
                                                    </div>
                                                </div>
                                                <div class="d-flex mb-3">
                                                    <span>任务描述：</span>
                                                </div>
                                                <p class="my-2">
                                                    {{ task.task_description }}
                                                </p>
                                                <div class="d-flex justify-content-between mt-4">
                                                    <div class="product-price">
                                                        <span>薪资标准：{{ task.task_salary }}元/条</span>
                                                    </div>
                                                    <button class="product-cart-btn" type="button"><a
                                                            href="{% url 'task_market:task_apply' task_id=task.id %}">申请</a>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                    <div class="col-12">
                        <div class="pagination" style="text-align: center">
                            <ul class="pagination-list">
                                <li><a href="#"><i class="ti-arrow-left"></i></a></li>
                                <li><a href="#">1</a></li>
                                <li class="active"><a href="#">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#"><i class="ti-arrow-right"></i></a></li>
                            </ul>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </section>

{% endblock %}


{% block view %}

    {% for task in tasks %}
        <div class="modal" id="staticBackdrop{{ task.id }}" data-bs-backdrop="static" data-bs-keyboard="false"
             tabindex="-1" aria-labelledby="staticBackdrop" aria-hidden="true">
            <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
                <div class="modal-content">
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <img src="{% static 'temp_shop/assets/img/products/p1.png' %}" alt="#">
                            </div>
                            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                <div class="quickview-content">
                                    <div class="d-flex mb-3"></div>
                                    <h2>{{ task.task_name }}</h2>
                                    <div class="d-flex mb-3">
                                        <span>任务描述：</span>
                                    </div>
                                    <div class="d-flex mb-3">
                                        <b>{{ task.task_description }}</b>
                                    </div>
                                    <div class="d-flex mb-3"></div>
                                    <div class="d-flex mb-3">
                                        <span>薪资标准：</span>
                                    </div>
                                    <h2>{{ task.task_salary }}元/条</h2>
                                    <div class="add-to-cart">
                                        <a href="{% url 'task_market:details' id=task.id %}" class="btn">详情信息</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endfor %}

{% endblock %}